<template>
	<!-- 校友名片 -->
	<view class="mycard-container">
		<!-- 名片显示 -->
		<view class="card">
			<image src="/static/img/alumni/card.png" mode="widthFix"></image>
			<view class="info">
				<view class="img">
					<image :src="detail.img" mode="widthFix"></image>
				</view>
				<view class="wrap">
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon1.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">在校时间</view>
						</view>
						<view class="item-r">{{detail.school_time||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon2.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">学历</view>
						</view>
						<view class="item-r">{{detail.degree||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon3.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">学院</view>
						</view>
						<view class="item-r">{{detail.college||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon4.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">专业</view>
						</view>
						<view class="item-r">{{detail.major||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon5.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">手机号</view>
						</view>
						<view class="item-r">{{detail.mobile||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon6.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">邮箱</view>
						</view>
						<view class="item-r">{{detail.email||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon7.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">微信</view>
						</view>
						<view class="item-r">{{detail.wechat||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon8.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">工作单位</view>
						</view>
						<view class="item-r">{{detail.workplace||'-'}}</view>
					</view>
					<view class="item">
						<view class="item-l">
							<view class="item-l-img">
								<image src="/static/img/card_icon/card_icon9.png" mode="widthFix"></image>
							</view>
							<view class="item-l-title">职务</view>
						</view>
						<view class="item-r">{{detail.post||'-'}}</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 底部按钮-接口数据不正确，先隐藏 -->
		<!-- <BottomButton @setHandleBtn="getHandleBtn">
			<template>
				<view>确认修改</view>
			</template>
		</BottomButton> -->
	</view>
</template>

<script>
	import BottomButton from '@/componets/BottomButton/BottomButton.vue'
	export default {
		data() {
			return {
				// 详情
				detail: {},

			}
		},
		methods: {

			/**
			 * 修改名片
			 */
			getHandleBtn() {
				this.$request.post({
					url: '/api/users/updateBusinessCard',
					data: {
						mobile,
						career,
						workplace,
						profession,
						post
					},
					success: res => {
						console.log(res)
						uni.showToast({
							title: res.result,
							icon: 'none'
						})
					}
				})
			},

			/**
			 * 获取校友详情
			 */
			getDetail() {
				this.$request.post({
					url: '/api/users/getCardInfo',
					data: {
						user_id: uni.getStorageSync('user_data').id
					},
					success: res => {
						if (res.code != 200) return uni.showToast({
							title: res.msg,
							icon: 'none'
						})
						this.detail = res.result.data
					}
				})
			}
		},
		onLoad() {
			this.getDetail()
		},
		components: {
			BottomButton
		}
	}
</script>

<style lang="less" scoped>
	.mycard-container {
		width: 100%;
		min-height: 100vh;
		background-color: #f6f6f6;
		overflow: hidden;
		padding-bottom: 258rpx;
		box-sizing: border-box;
		position: relative;

		.card {
			width: 618rpx;
			height: 890rpx;
			margin: 98rpx auto 0;
			position: relative;
			z-index: 5;

			>image {
				position: absolute;
				width: 100%;
			}

			.info {
				width: 100%;
				height: 100%;
				background-color: transparent;
				position: relative;
				padding-top: 182rpx;
				box-sizing: border-box;

				.img {
					width: 220rpx;
					height: 220rpx;
					border: 10rpx solid #fff;
					box-sizing: border-box;
					border-radius: 50%;
					overflow: hidden;
					position: absolute;
					left: 40rpx;
					top: -58rpx;
					z-index: 9;

					>image {
						width: 100%;
					}
				}

				.wrap {
					width: 100%;
					padding: 0 40rpx;
					box-sizing: border-box;

					.item {
						width: 100%;
						display: flex;
						align-items: center;
						margin-top: 36rpx;

						&-l {
							width: 206rpx;
							display: flex;
							align-items: center;

							&-img {
								width: 32rpx;
								height: 32rpx;
								margin-right: 12rpx;

								>image {
									width: 100%;
								}
							}

							&-title {
								font-size: 28rpx;
								font-family: Source Han Sans CN-Medium, Source Han Sans CN;
								font-weight: 500;
								color: #333333;
								line-height: 28rpx;
								letter-spacing: 1px;
							}
						}

						&-r {
							flex: 1;
							font-size: 28rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #333333;
							line-height: 28rpx;
							letter-spacing: 1px;
						}
					}
				}
			}
		}

	}
</style>